#! /bin/bash
pid=$*
jar_file=`ps aux|grep $pid|grep java|grep -v grep|awk '{for(i=1;i<=NF;++i){if(index($i,".jar")>=1){print $i}}}'|awk -F ':' '{for(i=1;i<NF;++i){if(index($i,".jar")>1)print $i}}'|head -1`

if [ $jar_file ];then
  lib_path=`dirname $jar_file`
  cd $lib_path/../
  echo `pwd`/
fi


